﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WordTemplate2.Pannel
{
    public partial class NumberColumnPanel : Form
    {
        public int number_board_type = 0;
        public NumberColumnPanel()
        {
            InitializeComponent();
            domainUpDown1.SelectedIndex = 0;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (number_board_type == 0)
            {
                object style = "标准文件_数字编号列项";
                Globals.ThisDocument.Application.Selection.ParagraphFormat.set_Style(ref style);
                Globals.ThisDocument.Application.Selection.TypeText(domainUpDown1.Text + ")　");
            }
            else if (number_board_type == 1)
            {
                object style = "标准文件_示例×：";
                Globals.ThisDocument.Application.Selection.ParagraphFormat.set_Style(ref style);
                Globals.ThisDocument.Application.Selection.TypeText("示例" + domainUpDown1.Text + "：");
            }
            else
            {
                object style = "标准文件_注×：";
                object type = Microsoft.Office.Interop.Word.WdNumberType.wdNumberParagraph;
                Globals.ThisDocument.Application.Selection.ParagraphFormat.set_Style(ref style);
                Globals.ThisDocument.Application.Selection.TypeText("注" + domainUpDown1.Text + "：");
                Globals.ThisDocument.Application.Selection.Range.ListFormat.RemoveNumbers(ref type);
            }

            this.Visible = false;
            this.Close();
        }
    }
}
